<template>
	<view>
		<!-- 搜索组件 -->
		<view class="search-box">
			<my-search @search="gotoSearch"></my-search>
		</view>

		<!-- 轮播图区域 -->
		<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" :circular="true">
			<swiper-item v-for="(item,index) in swiperList" :key="index">
				<navigator class="swiper-item" :url="'/subPackages/goods_detail/goods_detail?goods_id='+item.goods_id">
					<image :src="item.image_src" mode="widthFix"></image>
				</navigator>
			</swiper-item>
		</swiper>

		<!-- 导航区 -->
		<view class="nav-list">
			<view class="nav-item" v-for="(item,index) in navList" :key="index" @click="navClickHandler(item)">
				<image :src="item.image_src" class="nav-img"></image>
			</view>
		</view>

		<!-- 楼层区域 -->
		<view class="floor-list">
			<view class="floor-item" v-for="(item,index) in floorList" :key="index">
				<!-- 楼层标题区 -->
				<image :src="item.floor_title.image_src" class="floor-title"></image>
				<!-- 楼层图片区 -->
				<view class="floor-img-box">
					<navigator class="left-img-box" :url="item.product_list[0].url">
						<image :src="item.product_list[0].image_src"
							:style="{width: item.product_list[0].image_width + 'rpx'}" mode="widthFix">
						</image>
					</navigator>
					<view class="right-img-box">
						<navigator class="right-img-item" v-for="(item_right, index_right) in item.product_list"
							:url="item_right.url" :key="index_right" v-if="index_right !== 0">
							<image :src="item_right.image_src" mode="widthFix"
								:style="{width: item_right.image_width + 'rpx'}">
							</image>
						</navigator>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script src="./home.js"></script>

<style lang="scss">
	@import "./home.scss"
</style>
